/*
*
==============================================================================
*  Name        : 
*  Part of     : Omen Game Engine - Example Game
*  Description : 
*  Version     : 1.0
*
*  Copyright (c) 2013 Lauri Kortevaara.
* 
==============================================================================

// Omen Game class                                                                                     //
//                                                                                                     //
// To build: define OMEN_ENGINE Environment variable which points to the OmenEngine-directory.         //
// The path definition must end to \                                                                   //
// For example C:\Development\GameEngine_Omen\OmenEngine\")                                            //
//                                                                                                     //
//                                                                                                     //

*/

#pragma once

#include <OmenEngine>
#include <OmenEventHandler.h>

#include <OmenMouseEvent.h>
#include <OmenKeyboardEvent.h>
#include <OmenFrameEvent.h>

class OmenGame : public Omen::EventHandler
{

public:
    OmenGame(void);
    ~OmenGame(void);

    bool initialize();
    void run();

    // Event handlers
    void OnMouseEvent( const Omen::MouseEvent* event );
    void OnKeyboardEvent( const Omen::KeyboardEvent* event );
    void OnFrameEvent(const Omen::FrameEvent* event );
    void OnMouseWheelEvent(const Omen::MouseWheelEvent* event);

    void getMovementDirection( Omen::Vector3d& direction );
    void updateCamera();

private:
    Omen::IKernel&              m_pKernel;
    Omen::IRenderer*            m_pRenderer;
    Omen::ISceneManager*        m_pSceneManager;
    Omen::IAssetManager*        m_pAssetManager;

    Omen::IModel*               m_pTorusModel;
    Omen::IModel*               m_pCube;
    Omen::IModel*               m_pUnitSphere;

    Omen::ICamera*              m_pCurrentCamera;
    Omen::Vector3d              m_movementDirection;
    Omen::Float                 m_playerSpeedForward;
    Omen::Float                 m_yaw;
    Omen::Float                 m_pitch;
    Omen::Float                 m_roll;

    bool                        m_keyUp, m_keyDown, m_keyLeft, m_keyRight, m_keyQ, m_keyE;
};

